<template>
    <Breadcrumb separator='>'>

        <BreadcrumbItem
                v-for="item in currentPath"
                :to="item.path"
                :key="item.name"
        >{{ itemTitle(item) }}
        </BreadcrumbItem>
    </Breadcrumb>
</template>

<script>
	/**
	 * Created by c.k on 2018-1-7
	 * 文件说明:面包屑模板
	 */
	export default {
		name: 'breadcrumbNav',
		props: {
			currentPath: Array
		},
		methods: {
			itemTitle(item) {
				if (typeof item.title === 'object') {
					return this.$t(item.title.i18n);
				} else {
					return item.title;
				}
			}
		}
	};
</script>

